"Transparent Corruption: The effect of illicit connections and trusted references on the demand for bureaucratic intermediation" 

Authors: Jose Ramon Morales-Arilla & Ana Gabriela Ibarra Luces


This README file includes detailed explanation on the scripts presented to replicate the results for the "Transparent Corruption" paper. All the scripts are available in the "Code" folder within the "Replication files" folder. The input or raw data is available in the "Data/Raw" folder. The generated outputs will be stored within the "Data/Output" folder. 

00_Master-File.R: This script sources all the available scripts in order to replicate the results. Before running this script the working directory (setwd()) should be set to the "Replication files" folder route in your PC. By running this master file script, all outputs will be generated and exported to the existing folders specified within the "Replication files" folder. 

01_Data-Cleansing.R: This script performs the data cleansing by processing and transforming variables. It takes as an input the file corresponding to the raw survey data: "Data/Raw/Survey_Servicios_Burocraticos_October 5, 2022_13.17.sav". It generates as an output the clean dataset file `01_dataset_transparent_corruption` in two formats (CSV and XLSX) in the folder "Data/Output/Dataset".

02_Regression-Analysis.R: This script performs the regression analysis for tables presented in the paper. It takes as an input the dataframe `tabla_survey`, generated in script `01_Data-Cleansing.R`. It exports an XLSX file with all the regression table results: "Data/Output/Tables/02_regression_tables.xlsx".

03_Figures.R: This script generates and exports all the figures presented in the paper. It takes as an input the dataframe `tabla_survey`, generated in script `01_Data-Cleansing.R`, and the regressions generated in script `02_Regression-Analysis.R`. It exports all the figures in a PDF format in the following folder: "Data/Output/Figures".

04_Attrition_Analysis.R: This script generates the attrition analysis table for each of the treatment variables. It takes as an input the dataframe `tabla_survey`, generated in script `01_Data-Cleansing.R`. It exports the attrition analysis table in an XLSX format: "Data/Output/Tables/04_attrition_analysis_table.xlsx".

05_Balance_Tests.R: This script generates the balance tests table for each treatment variable and covariate of interest. It takes as an input the dataframe `tabla_survey`, generated in script `01_Data-Cleansing.R`. It exports the balance tests table `05_balance_tests_table` in two formats (XLSX and TEX) in the folder "Data/Output/Tables". 

06_Summary_Statistics.R: This script generates a summary statistics table for the main analysis variables. It takes as an input the dataframe `tabla_survey`, generated in script `01_Data-Cleansing.R`. It exports the summary statistics table in an XLSX format in the folder "Data/Output/Tables/06_summary_stats.xlsx". 